package com.example.weight.navigation;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;

import com.example.weight.R;
import com.example.weight.greenSeasons.waterDeal.IdentitySelectActivity;
import com.example.weight.greenSeasons.waterDeal.*;
import com.example.weight.householdWaste.ChoseRoleActivity;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;

public class SijiqingWaterDealNavActivity extends AppCompatActivity {

    private String name, factory;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sijiqing_water_deal_nav);

        Intent previousIntent = getIntent();
        name = previousIntent.getStringExtra("name");
        factory = previousIntent.getStringExtra("factory");

        TitleBar titleBar = findViewById(R.id.sijiqing_water_deal_nav_titleBar);
        titleBar.setOnTitleBarListener(new OnTitleBarListener() {
            @Override
            public void onLeftClick(View v) {
                finish();
            }

            @Override
            public void onTitleClick(View v) {}

            @Override
            public void onRightClick(View v) {}
        });
    }

    public void turnEquipmentRunning(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ChoseRoleActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("fName", "shebeiyunxing8_1");
        startActivity(intent);
    }
//    public void turnEquipmentRunningCheck(View view) {
//        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ChoseRoleActivity.class);
//        intent.putExtra("name", name);
//        intent.putExtra("fName", "equipmentRunningCheck");
//        startActivity(intent);
//    }
    public void turnBackWash(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, BackwashTable_old.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }
    public void turnSendWater(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, SendWaterTable.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }
    public void turnUseElectricity(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, UseElectricityTable.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }
    public void turnEquipmentCheck(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ChoseRoleActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("fName", "shebeijiancha8_4_old");
        startActivity(intent);
    }
    public void turnEquipmentDailyMaintain(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ChoseRoleActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("fName", "equipmentDailyMaintain");
        startActivity(intent);
    }
//    public void turnEquipmentDailyMaintain(View view) {
//        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, IdentitySelectActivity.class);
//        intent.putExtra("name", name);
//        intent.putExtra("type", "daily");
//        startActivity(intent);
//    }
    public void turnEquipmentWeeklyMaintain(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ChoseRoleActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("fName", "equipmentWeeklyMaintain");
        startActivity(intent);
    }
    public void turnEquipmentMonthlyMaintain(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ChoseRoleActivity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        intent.putExtra("fName", "equipmentMonthlyMaintain_old");
        startActivity(intent);
    }
    public void turnErrorRecord(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, ErrorRecordTable.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }
    public void turnWaterTreatment(View view) {
        Intent intent =new Intent(SijiqingWaterDealNavActivity.this, WaterTreatmentTable_old.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }

    public void turnBrowser(View view){
        Uri uri = Uri.parse("http://39.105.29.195/#/login");
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        startActivity(intent);
    }
}
